Imports KanBan.Pgd.Domain.Exceptions

Public Class EntityValidationException
    Inherits BusinessRuleException

    Public Sub New(ByVal errors As IList(Of EntityValidationError))
        MyBase.New("Entity validation error occurred")
        Me.ValidationErrors = errors
    End Sub

    Public Sub New(ByVal message As String, ByVal errors As IList(Of EntityValidationError))
        MyBase.New(message)
        Me.ValidationErrors = errors
    End Sub

    Public Sub New(ByVal message As String, ByVal innerException As Exception, ByVal errors As IList(Of EntityValidationError))
        MyBase.New(message, innerException)
        Me.ValidationErrors = errors
    End Sub

    Private _validationErrors As IList(Of EntityValidationError) = New List(Of EntityValidationError)
    Public Property ValidationErrors() As IList(Of EntityValidationError)
        Get
            Return _validationErrors
        End Get
        Set(ByVal value As IList(Of EntityValidationError))
            _validationErrors = value
        End Set
    End Property

End Class
